Skip to content
This repository has been archived by the owner on Sep 1, 2020. It is now read-only.

On clean server builds, the deploy scripts fail because bundler is not installed #14

Closed
wants to merge 1 commit into from

Conversation

DDAZZA
Copy link
Contributor

@DDAZZA DDAZZA commented Dec 9, 2011

The setup should ensure that bundler is installed otherwise the deploy scripts will fail.

Alternatively there could be documentation which should say that bundler is a prerequisite.

@mislav
Copy link
Owner

mislav commented Dec 9, 2011

Your concern is in the right place but I'm not sure about this solution. Often, the gem install command will require sudo privileges. And also, multiple versions of Ruby are now popular though RVM, rbenv or other methods. Each of those versions needs bundler. So just running "gem install" might give an illusion that it is enough when if fact it's not.

Maybe there could be a "doctor" command which could perform a couple of checks on your server and report if anything is missing. I want to leave the process of actually installing stuff out of git-deploy.

@longlostnick
Copy link

are the hooks run by the same user that pushed? I'm getting a bundler error, even though I know bundler is installed for the user I'm ssh'ing/pushing with. If I run the hook on the server using ./before_restart, it runs fine.

@mislav
Copy link
Owner

mislav commented Dec 30, 2011

Yes hooks are run as same user that you ssh with. However your environment (such as PATH) might be different. See my other comment

@longlostnick
Copy link

Fantastic, thanks!

Update: ok I thought I would be able to fix it myself, but env is way off between the two. PATH looks to be the same, but the hook env is missing all of the rvm_ prefixed variables and some others like GEM_PATH. One of those must be the problem. Is there a way to get those to be the same by sourcing .bash_profile or initialize rvm or something before the script runs?

@blt
Copy link
Contributor

blt commented Jan 20, 2012

My pull request will source the appropriate startup files for RVM or rbenv.

Bundler is only a pre-requisite if before_restart makes use of it, no? The only required softwares on the production machine are those referenced in the hooks, which might easily be rewritten to use shell script alone if a project needed no more.

@davydotcom
Copy link

having this issue as well...ubuntu 11.10 rvm system install

mislav added a commit that referenced this pull request Apr 3, 2012
First of all, we're lying - the shell isn't interactive. Second, it
causes the issue described in #30.

We'll have to find another way to support rbenv and RVM installations.

references #19, references #14
@davydotcom
Copy link

Found a solution for this. This occurred because i was using rvm and the shell is not properly initializing rvm. Recommend using rvm wrapper to set this up... for example

rvm wrapper 1.9.3 git
this will create a binary called git_ruby

modiify line 1 in deploy/before_restart as such

#!/usr/bin/env git_ruby

all is well.

@mateomurphy
Copy link

Thanks for the tip, @davydotcom, solved my problem!

@mislav
Copy link
Owner

mislav commented Jul 11, 2013

Closing since Ruby setup and Bundler installation is best done outside of git deploy, i.e. by a sysadmin.

@mislav mislav closed this Jul 11, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants